package com.ruoyi.train.service.impl;

import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.train.domain.JyTrainingSchoolCourseOutline;
import com.ruoyi.train.mapper.JyTrainingSchoolCourseOutlineMapper;
import com.ruoyi.train.service.IJyTrainingSchoolCourseOutlineService;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 培训课程大纲Service业务层处理
 *
 * @author aulbrother
 * @date 2024-04-06
 */
@Service
@RequiredArgsConstructor
public class JyTrainingSchoolCourseOutlineServiceImpl implements IJyTrainingSchoolCourseOutlineService {
    private final JyTrainingSchoolCourseOutlineMapper jyTrainingSchoolCourseOutlineMapper;

    /**
     * 查询培训课程大纲
     *
     * @param id 培训课程大纲主键
     * @return 培训课程大纲
     */
    @Override
    public JyTrainingSchoolCourseOutline selectJyTrainingSchoolCourseOutlineById(Long id) {
        return jyTrainingSchoolCourseOutlineMapper.selectJyTrainingSchoolCourseOutlineById(id);
    }

    /**
     * 查询培训课程大纲列表
     *
     * @param jyTrainingSchoolCourseOutline 培训课程大纲
     * @return 培训课程大纲
     */
    @Override
    public List<JyTrainingSchoolCourseOutline> selectJyTrainingSchoolCourseOutlineList(JyTrainingSchoolCourseOutline jyTrainingSchoolCourseOutline) {
        return jyTrainingSchoolCourseOutlineMapper.selectJyTrainingSchoolCourseOutlineList(jyTrainingSchoolCourseOutline);
    }

    /**
     * 修改培训课程大纲
     *
     * @param jyTrainingSchoolCourseOutline 培训课程大纲
     * @return 结果
     */
    @Override
    public int updateJyTrainingSchoolCourseOutline(JyTrainingSchoolCourseOutline jyTrainingSchoolCourseOutline) {
        jyTrainingSchoolCourseOutline.setUpdateTime(DateUtils.getNowDate());
        return jyTrainingSchoolCourseOutlineMapper.updateJyTrainingSchoolCourseOutline(jyTrainingSchoolCourseOutline);
    }

    @Override
    public List<JyTrainingSchoolCourseOutline> selectJyTrainingSchoolCourseOutlineByCourseId(Long schoolCourseId){
        return jyTrainingSchoolCourseOutlineMapper.selectJyTrainingSchoolCourseOutlineByCourseId(schoolCourseId);
    }
}
